# Support for out-of-tree builds (VPATH)
srcdir = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = @top_builddir@
VPATH = @srcdir@

CC=@CC@
LDFLAGS=@LDFLAGS@
CFLAGS=@CFLAGS@
AM_CFLAGS=@NDPI_CFLAGS@
INC=-I $(top_srcdir)/src/include -I $(top_builddir)/src/include -I/usr/local/include
LIBDPI=$(top_builddir)/src/lib/libndpi.a
AM_LDFLAGS=@NDPI_LDFLAGS@
LIB=$(LIBDPI) @ADDITIONAL_LIBS@ @LIBS@ -lm
GEN_HEADERS=$(top_builddir)/src/include/ndpi_config.h $(top_builddir)/src/include/ndpi_define.h

TOOLS=metric_anomaly

all: $(TOOLS)

metric_anomaly: $(srcdir)/metric_anomaly.c Makefile $(LIBDPI) $(GEN_HEADERS)
	$(CC) $(AM_CFLAGS) $(CFLAGS) $(CPPFLAGS) $(INC) $(AM_LDFLAGS) $(LDFLAGS) $(srcdir)/metric_anomaly.c -o metric_anomaly $(LIB)

clean:
	$(RM) *.o *.lo $(TOOLS) *~
	$(RM) -r .libs .deps

distclean: clean
	$(RM) Makefile

distdir:
	find $(srcdir) -type f -name '*.c' \
		-o -name '*.txt' | xargs -I'{}' cp '{}' '$(distdir)/{}'

install:
	@echo -n ""

check:
	true # nothing to do here
